<?php

namespace apps\marriage\app\mp\controller;

use apps\marriage\core\model\MemberReport;
use apps\marriage\core\service\MemberReportService;
use think\Request;

class MemberReportController extends BaseMarriageMpController
{
    /**
     * @var MemberReportService
     */
    private $memberReportService;

    protected function init()
    {
        parent::init();
        $this->memberReportService = service('MemberReport', SERVICE_NAMESPACE);
    }

    public function save(Request  $request)
    {
        $data = $request->param();
        $data['user_id'] = $this->user['id'];
        $data['status'] = MemberReport::STATUS_WAIT_HANDLE;
        $data['dateline'] = time();
        $this->memberReportService->create($data);
        return $this->success();
    }
}